import { getChannelApi } from '@/apis/article'
import { useState, useEffect } from 'react'

function useChannels() {
  const [channelList, setChannelList] = useState([])
  useEffect(() => {
    async function getChannel() {
      const res = await getChannelApi()
      setChannelList(res.data.channels)
    }
    getChannel()
  }, [])
  return {
    channelList
  }
}

export default useChannels